package com.example.spring.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.spring.demo.common.model.vo.ReportVo;
import com.example.spring.demo.entity.GoodsReport;
import org.apache.ibatis.annotations.Select;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2024/12/31 10:53
 **/
public interface GoodsReportMapper extends BaseMapper<GoodsReport> {
    //查询举报列表
    @Select("""
select gr.report_id, g.goods_name, g.image, u.nick_name,gr.report_time,gr.reason, gr.status
from goods_report as gr
inner join goods as g on gr.goods_id = g.goods_id
inner join wx_user as u on gr.report_user = u.user_id
order by gr.report_time desc
""")
    IPage<ReportVo> getList(IPage<ReportVo> page);
}
